package com.gopay.common.user.manager;

import com.gopay.common.base.manager.BaseManager;
import com.gopay.common.domain.cust.CustPersonInfo;

import java.io.Serializable;
import java.util.List;

/**
 * CustPersonInfoQuery Manager
 * 
 * @CustPersonInfoQueryManager.java
 * @author liuxin
 * @2013-1-6 下午2:05:00 www.gopay.com.cn Inc.All rights reserved.
 */
public interface CustPersonInfoQueryManager extends BaseManager<CustPersonInfo, Serializable> {

    public int getMobileNoCount(String mobileNo);
    
    public CustPersonInfo getByMobileNo(String mobileNo);
    
    public CustPersonInfo getByCustId(String custId);
    
    public int getByCertTypeAndCertNo(String certType, String certNo);
    
    public CustPersonInfo getByEmail(String email);
    
    /**
     * 获取已开通的用户
     * @param email
     * @return
     */
    public List<CustPersonInfo> getCustPersonOpen(String email);

    /**
     * 根据手机号且只根据手机号获取个人信息
     * @param mobile
     * @return
     */
    public CustPersonInfo getByCustMob(String mobile);

    public CustPersonInfo getNoActiveCustByCustMob(String mobileNo);
    public CustPersonInfo getNoActiveCustByCustEmail(String email);

    
    /**
     * 修改CustPersonInfo
     * @param custPersonInfo
     */
    public void updateByCustId(CustPersonInfo custPersonInfo);
    /**
     * 根据手机号查询正常
     * @param mobile
     * @return
     */
    public CustPersonInfo findByCustMobmobile(String mobile) ;
    /**
     * 根据手机号查询所有状态
     * @param mobile
     * @return
     */   
    public CustPersonInfo findByCustMobmobileAllStatus(String mobile);

    
    /**
     * 根据证件号查询个人信息
     * @param custName
     * @param certType
     * @param certNo
     * @return
     */
    public List<CustPersonInfo> getByCertNo(String custName, String certType, String certNo);

    /**
     * 
     * 根据用户名，身份证类型，身份证号，实名认证状态查询个人信息
     * @param custName
     * @param certType
     * @param certNo
     * @param isRealNameCertifyList
     * @return 
     * @author hougn
     */
    List<CustPersonInfo> findByCNameAndCTypeAndCNoAndRNameIn(String custName, String certType, String certNo,
            List<String> isRealNameCertifyList);
    

    
    /**
     * 根据身份证号码查询客户信息记录列表
     */
    public List<CustPersonInfo> findByCustListBycertNo(String certType,String certNo,String isRealNameCertify); 
    
    /**
     * 根据合作方custID查询信息
     */
    public List<CustPersonInfo> findByCustListByPartnerId(String certType,String certNo,String isRealNameCertify); 


    /**
     * @param email
     * @return
     * @Desc 根据邮箱及用户名和证件类型查询个人信息
     * @Date 2016/11/30 11:18 by xuexj
     */
    CustPersonInfo findByEmail(String email,String custName,String certType);

    /**
     * @param mob
     * @return
     * @Desc 根据手机号码及用户名和证件类型查询个人信息
     * @Date 2016/11/30 11:29 by xuexj
     */
    CustPersonInfo findByCustMob(String mob, String custName, String certType);


    CustPersonInfo getByMobileWithoutStat(String mobile);

    /**
     * 
     * 如何密码是sha1(长度=40),设置个人支付密码为sha512
     * @param sbNewPayPwd
     * @param person 
     * @author hougn
     */
    void setPersonNewPayPwd(StringBuilder sbNewPayPwd, CustPersonInfo person);

    /**
     * 
     * 如何密码是sha1(长度=40),设置个人手机支付密码为sha512
     * @param sbNewMtPayPwd
     * @param person 
     * @author hougn
     */
    void setPersonNewMtPayPwd(StringBuilder sbNewMtPayPwd, CustPersonInfo person);

    /**
     * 根据手机号获取个人信息
     * @param mobile
     * @return
     */
    List<CustPersonInfo> getByMobileListWithoutStat(String mobile);

    int findCustCountByCertNoWithoutCancelStat(String certType,String certNo);
    
    /**
     * 根据平台ID和唯一Id获取信息
     * @param merId
     * @param merCustId
     * @return
     */
	CustPersonInfo findByMerCustId(String merId, String merCustId);

}
